home *** CD-ROM | disk | FTP | other *** search
- @echo off
- rem Please ignore the "bad command" message. To stop it from recurring,
- rem edit COMPRESS.BAT, and remove the first line, which is supported
- rem only by DOS 3.3 and higher.
- echo off
- if %1x == x goto syntax
- if exist temp$$$$.com goto :error1
- if exist %1.com goto com
- if exist %1.exe goto exe
- echo Error: neither %1.COM nor %1.EXE was found.
- echo For an explanation of COMPRESS, just type COMPRESS.
- echo
- goto finish
- :syntax
- echo
- echo Syntax:
- echo COMPRESS programname
- echo
- echo Explanation of COMPRESS
- echo COMPRESS compresses executable files. The file can be
- echo either a .COM file or an .EXE file, and the result will
- echo be a .COM file of the same name.
- echo
- goto finish
- :com
- echo Compressing %1.COM
- echo
- copy %1.com temp$$$$.com
- scrnch /rso %2 temp$$$$.com %1.com
- if errorlevel 8 goto error2
- copy temp$$$$.com temp$old.com
- del temp$$$$.com
- echo
- echo COMPRESS is finished.
- echo The old version of %1.COM is saved as TEMP$OLD.COM.
- echo The new version is saved as %1.COM.
- echo Use the DIR command to see how much space was saved.
- goto finish
- :exe
- echo Compressing %1.EXE
- echo
- scre2b %1.exe temp$$$$.com
- if errorlevel 8 goto error3
- copy %1.exe temp$old.exe
- scrnch /rso %2 temp$$$$.com %1.exe
- if errorlevel 8 goto error4
- del temp$$$$.com
- echo
- echo COMPRESS is finished.
- echo The old version of %1.EXE is saved as TEMP$OLD.EXE.
- echo The new version is saved as %1.EXE.
- echo Use the DIR command to see how much space was saved.
- goto finish
- :error1
- echo Error: a previous run of COMPRESS left TEMP$$$$.COM on the
- echo disk. Perhaps it did not complete -- you should
- echo investigate.
- goto finish
- :error2
- echo Error: SCRNCH of %1.COM did not complete.
- del %1.com
- copy temp$$$$.com %1.com
- del temp$$$$.com
- goto finish
- :error3
- echo Error: %1.EXE could not be converted to .COM format.
- del temp$$$$.com
- goto finish
- :error4
- echo Error: SCRNCH of %1.EXE did not complete.
- del temp$$$$.com
- copy temp$old.exe %1.exe
- goto finish
- :finish